<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script language="JavaScript">
        var arr  = [[1,2,3],[4,5,6],[7,8,9]];
        var arr2 = [];
        for(var i = 0;i < arr[0].length;i++){
            arr2[i]=[];
        }
        for(var i = 0;i < arr.length;i++){
            for(var j = 0;j < arr[i].length;j++){
                arr2[j][i]=arr[i][j];
            }
        }
        //遍历arr2
        for(var i = 0;i < arr2.length;i++){
            for(var j = 0;j < arr2[i].length;j++){
                document.writeln(arr2[i][j]+"&nbsp");
            }
            document.writeln("<br/>");
        }
    </script>
</head>
<body>

</body>
</html>